import request from '@/utils/request'
/**
 * 添加文章
 * @param {} topic 
 * @returns  200
 */
export const addTopic = (topic) => {
    return request({
        url: '/topic/add/',
        method: 'post',
        data: topic
    })
}

/**
 * 根据id获取文章
 * @param {用户id} id 
 * @returns 
 */
export const getTopicById = (id)=>{
    return request({
        url:'/topic/getTopic/' +id,
        method:'get',
 
    })
}

export const getAllType=()=>{
    return request({
      url:'/topic/getAllType',
      method:'get'
    })
}

export const getTopic=(data)=>{
    return request({
      url:'/topic/getTopic',
      method:'post',
      data:data
    })
}